<template>
  <CustomDialog :drag-dialog="dialogInfo">
    <!--表格渲染-->
    <DataGridTable
      v-loading="loading"
      :sup_this="sup_this"
      :data="data.rtnList"
      :total="total"
      :show-page="false"
      :multi-select="false"
      :show-cell-class="true"
      :show-row-number="true">
      <el-table-column :show-overflow-tooltip="true" prop="funProcessName" label="业务类型">
        <template slot-scope="scope">
          <edit :data="scope.row" :sup_this="sup_this" />
        </template>
      </el-table-column>
      <el-table-column prop="selfStateName" label="状态"/>
      <el-table-column :show-overflow-tooltip="true" prop="busDate" label="业务日期">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.busDate) }}</span>
        </template>
      </el-table-column>
    </DataGridTable>
  </CustomDialog>
</template>

<script>
import initData from '@/mixins/initData'
import { parseTime } from '@/utils/index'
import edit from './edit'
import baseBom from '@/api/base/BaseBom'

export default {
  components: { edit },
  mixins: [initData],
  props: {
    sup_this: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      dialogInfo: {
        name: 'baseBomHistoryDialog',
        title: '所有版本记录',
        fullScreen: false,
        width: 500,
        height: 60
      },
      sysGenCode: '',
      loading: false
    }
  },
  created() {
    this.url = baseBom.loadHistoryDataUrl()
  },
  methods: {
    parseTime,
    displayDialog() {
      const { name } = this.dialogInfo
      this.$nextTick(() => {
        this.$modal.show(name)
      })
    },
    hiddenDialog() {
      const { name } = this.dialogInfo
      this.$nextTick(() => {
        this.$modal.hide(name)
      })
    },
    async beforeInit() {
      this.paramBean.sysGenCode = this.sysGenCode
      return true
    },
    initLoadDialog() {
      this.init()
      this.displayDialog()
    }
  }
}
</script>

<style scoped lang="less">
</style>
